const db = require("../../../libs/db");
const boom = require('boom');
const service = require("../../../service");

const getTestData = async function (req, res, next) {
    const id = req.query.id;
    if (!id) {
        // return next(boom.badRequest('id is required'))
        return res.json({
            success: false,
            message: 'id is required',
        })
    }
    const result = await service.getTestData(id)
    res.json({
        success: true,
        data: result,
        message: '数据需要事先插入一条才有数据哈 (≧ω≦)'
    })
    res.end()
}

module.exports = {
    getTestData
}
